package com.open.capacity.task.controller;


import com.open.capacity.common.web.PageResult;
import com.open.capacity.common.web.Result;
import com.open.capacity.task.model.TaskArea;
import com.open.capacity.task.service.TaskAreaService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@Slf4j
@RestController
@Api(tags = "TaskArea API")
@RequestMapping("/taskArea")
public class TaskAreaController {
    @Autowired
    TaskAreaService taskAreaService;

    @GetMapping("/findTaskArea")
    public Result findTaskArea(@RequestParam Map<String,Object> params){
        return taskAreaService.findTaskArea(params);
    }

    @PostMapping("/addTaskArea")
    public Result addTaskArea(@RequestBody TaskArea taskArea){
        return taskAreaService.addTaskArea(taskArea);
    }

    @PostMapping("/updateTaskArea")
    public Result updateTaskArea(@RequestBody TaskArea taskArea){
        return taskAreaService.updateTaskArea(taskArea);
    }
    @PostMapping("/deleteTaskArea")
    public Result deleteTaskArea(@RequestBody List<Integer> taskAreaIds){
        return taskAreaService.deleteTaskArea(taskAreaIds);
    }
}
